Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prioritize TURN servers according to they relay protocol #629

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

karaziox
Copy link

Description

Today, all relay candidates from Pion have the same priority. This PR attempts to reproduce libwebrtc's behavior, where the TURN servers candidates priority is based on the underlying relay protocol. UDP are preferred over TCP, which are preferred over the TLS options.

We reuse the same factors as libwebrtc:
https://github.com/mozilla/libwebrtc/blob/1389c76d9c79839a2ca069df1db48aa3f2e6a1ac/p2p/base/turn_port.cc#L61

@karaziox karaziox force-pushed the turn-server-priority branch from f7a98e2 to 3634d3b Compare March 19, 2024 17:15
@Sean-Der
Copy link
Member

Thank you so much @karaziox I am merging this now!

This is a pretty deep change! Anything else with Pion you would like to see improved? What else do you think could be better? Would love to hear what else you are looking at :)

@Sean-Der Sean-Der force-pushed the turn-server-priority branch from 3634d3b to a1d08a5 Compare March 20, 2024 18:37
Today, all relay candidates from Pion have the same priority.
This PR attempts to reproduce libwebrtc's behavior, where the
TURN servers candidates priority is based on the underlying
relay protocol. UDP are preferred over TCP, which are preferred
over the TLS options.
@Sean-Der Sean-Der force-pushed the turn-server-priority branch from a1d08a5 to 82e739b Compare March 20, 2024 18:37
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 14.28571% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 78.68%. Comparing base (67cc918) to head (82e739b).

Files Patch % Lines
candidate_relay.go 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #629      +/-   ##
==========================================
- Coverage   78.80%   78.68%   -0.13%     
==========================================
  Files          42       42              
  Lines        4454     4466      +12     
==========================================
+ Hits         3510     3514       +4     
- Misses        725      734       +9     
+ Partials      219      218       -1     
Flag Coverage Δ
go 78.68% <14.28%> (-0.13%) ⬇️
wasm 23.50% <0.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sean-Der Sean-Der merged commit 8680cd5 into pion:master Mar 20, 2024
12 of 13 checks passed
@karaziox karaziox deleted the turn-server-priority branch March 20, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants